package com.moolng.service;

import io.seata.rm.tcc.api.BusinessActionContext;

import java.math.BigDecimal;

/**
 * @author 李权
 * @description
 * @date 2021/1/6 18:09
 */
public interface AccountApi {
    
    /**
     * 扣减账户余额
     * @param actionContext save xid
     * @param userId 用户id
     * @param money 金额
     * @return
     */
    
//    @RequestMapping("/account/decrease")
    boolean prepare(BusinessActionContext actionContext, Long userId, BigDecimal money);
    
    /**
     * Commit boolean.
     *
     * @param actionContext save xid
     * @return the boolean
     */
//    @RequestMapping("/account/commit")
    boolean commit(BusinessActionContext actionContext);
    
    /**
     * Rollback boolean.
     *
     * @param actionContext save xid
     * @return the boolean
     */
//    @RequestMapping("/account/rollback")
    boolean rollback(BusinessActionContext actionContext);
    
}
